//---------------------------------------------------------------------------- Strict
'use strict'
//---------------------------------------------------------------------------- Package
const _ = require('lodash')
const mysql = require('mysql')
//---------------------------------------------------------------------------- Env
const env = 'dev'
//---------------------------------------------------------------------------- Port
const port = 3000
//---------------------------------------------------------------------------- Conf
const conf = {
  dev: {
    wechat: {
      appid: "wx520cef2ebf7b3fec",
      appsecret: "76a552852815b2c13f98af3e00f31c16",
      scope: "snsapi_userinfo"
    },
    mysql: {
      user: mysql.createPool({
        host: "127.0.0.1",
        user: "root",
        password: "123456",
        database: "hdb_user_mysql"
      }),
      wechat: mysql.createPool({
        host: "127.0.0.1",
        user: "root",
        password: "123456",
        database: "hdb_wechat_mysql"
      }),
      log: mysql.createPool({
        host: "127.0.0.1",
        user: "root",
        password: "123456",
        database: "hdb_log_mysql"
      })
    }
  },
  //-------------------------------------------------------------------------- Pro
  pro: {
    wechat: {
      appid: "wx520cef2ebf7b3fec",
      appsecret: "76a552852815b2c13f98af3e00f31c16",
      scope: "snsapi_userinfo"
    },
    mysql: {
      user: mysql.createPool({
        host: "127.0.0.1",
        user: "root",
        password: "123456",
        database: "hdb_user_mysql"
      }),
      wechat: mysql.createPool({
        host: "127.0.0.1",
        user: "root",
        password: "123456",
        database: "hdb_wechat_mysql"
      }),
      log: mysql.createPool({
        host: "127.0.0.1",
        user: "root",
        password: "123456",
        database: "hdb_log_mysql"
      })
    }
  }
}
//---------------------------------------------------------------------------- Exports
global.conf = _.merge({ env, port }, conf[env])